﻿/************************************************
*Author: KIM
*Create Time: 2/16/2017 1:34:58 PM
*CLR Version: 4.0.30319.42000
*Description:
*
*Update History:
*
***********************************************/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace ACC.Extensions.Utilities
{
    public class FileHelper
    {
        public static string ReadFile(string filePath)
        {
            string content = String.Empty;
            //检查文件是否存在
            if(!File.Exists(filePath))
            {
                return content;
            }

            using(Stream stream = new FileStream(filePath, FileMode.Open, FileAccess.Read))
            {
                using(StreamReader reader = new StreamReader(stream))
                {
                    content = reader.ReadToEnd();
                }
            }
            return content;
        }
    }
}
